import { mb } from '../../../gen/pb';
export let UserInfo = mb.UserInfo;
export type UserInfo = mb.UserInfo;

export interface IUserService {
	Get(id: string): Promise<mb.UserInfo>;
	GetByPhone(phone: string);
	SendVerifyCode(phone: string, code: string);
	ExistId(id: string);
	ExistPhone(phone: string);
	UpdateUser(id: string, info?: UserInfo): Promise<UserInfo>;
	IsTokenValid(id: string, token: string);
	updateViewNums(id: string, viewsNums: number, changeMax: boolean);
	updateMemberLevel(id: string, userLevel: number, dueDate: string);
	updateServersInfo(id: string, serversInfo: string);
}

export let tsIUserService = Symbol.for('IUserService');

export let VERSION_20190430 = 20190430;
export let VERSION_20190506 = 20190506;
export let VERSION_NOW = VERSION_20190506;

export interface ActionType {
	srcHost: string;
}
export interface NewGuestActionType extends ActionType {
	type: string;
	id: string;
	info: UserInfo;
}
